package com.wonders.test;
import java.util.*;
import javax.mail.internet.*;
import javax.mail.*;

public class testmail {
    public static void main(String[] args) throws AddressException,
            MessagingException {
        Properties mailpro = new Properties();
        mailpro.setProperty("mail.smtp.host", "smtp.163.com");
        mailpro.setProperty("mail.smtp.auth","false");
        Session session = Session.getDefaultInstance(mailpro);
        session.setDebug(true);
        MimeMessage msg = new MimeMessage(session);
        msg.setFrom(new InternetAddress("13897483797@163.com"));
        msg.setRecipient(Message.RecipientType.TO,
                new InternetAddress("1321407101@qq.com"));
        msg.setSubject("测试免认证方式发送邮件！！！");
        msg.setText("测试一下，邮件来自 http://www.donews.net/lizongbo ");
        Transport.send(msg);
    }
}
